/*8：如果斐波拉切数列的前N项，N由用户输入。
斐波拉切数列的定义是前两个是1，后面的每一个是前面的两个和
，比如N是5,则输出结果是1,1,2,3,5*/
package ZUOYE0421;

import java.util.Scanner;

public class 作业八 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入N：");
		int n = in.nextInt();
		n = n - 2;
		int a = 1, b = 1, c = 0;
		System.out.print("1,");
		System.out.print("1,");
		for (int d = 1; d <= n;) {
			c = a + b;
			if (d == n) {
				System.out.print(c + "。");
			} else {
				System.out.print(c + ",");
			}
			a = b;
			b = c;
			d++;
		}

	}

}
